import request from '@/utils/request'

/** ---------------加盟商列表-------------------- */
/**
 * 列表
 * @param {*} data
 */
 export function crmSourceListAPI(data) {
  return request({
    url: 'crmSource/queryList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 新建 编辑
 * @param {*} data
 */
export function crmRoiSaveAPI(data) {
  const url = data.entity && data.entity.leadsId ? 'update' : 'add'
  return request({
    url: 'crmPutinMoney/' + url,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
/**
 * 获取平台列表
 * @param {*} data
 */
export function crmSourceAPI() {
  return request({
    url: 'crmSource/querySourceDataGroupByCode',
    method: 'post',
    data: {},
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 删除
 * @param {*} data
 */
export function crmSourcesDeleteAPI(data) {
  return request({
    url: `crmSource/deleteByIds`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 删除
 * @param {*} data
 */
 export function crmSourceDeleteAPI(data) {
  return request({
    url: `crmSource/deleteById/${data}`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 获取单条数据
 * @param {*} data
 */
 export function crmSourceInfoAPI(data) {
  return request({
    url: `crmSource/queryInfoById/${data}`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
